import React from 'react'
import style from '../Css/cart.module.css'
import { FileOutline } from 'antd-mobile-icons'
import { useNavigate, useSearchParams } from 'react-router-dom'
function Cartp(props) {
  let nav=useNavigate()
    const [sp]=useSearchParams()
    const date=sp.get('date')
  const tiaoz=()=>{
    nav(`/xq?${props.id}&start=${props.startStation}&end=${props.endStation}&date=${date}`)
  }
  return (
    <div className={style.box} onClick={tiaoz}>
        <div className={style.tt}>
        <div className={style.cc}>
            <span className={style.p1}>{props.startTime}</span>
            <span>{props.timeTaken}</span>
            <span className={style.p2}>{props.endTime}</span>
            <span className={style.p3}>￥{props.ssoftSeat.price}</span>

            <span> {props.startStation}</span>
            <span> {props.trainNo}<FileOutline /></span>
            <span> {props.endStation}</span>
            <span className={style.p4}> {props.ssoftSeat.ticketNum}
               {typeof props.ssoftSeat.ticketNum==='number'?'张':''}</span>
           
      </div>
      <span className={style.zk}>5月13日 8:00起售，可预约抢票，开售自动抢票</span>
        </div>
      
    </div>
  )
}

export default Cartp
